package org.example.utils;

import org.springframework.messaging.Message;
import org.springframework.messaging.core.MessagePostProcessor;
import org.springframework.messaging.support.MessageBuilder;

/**
 * @Author: tang
 * @Description:
 * @Date 2025/8/4 16:46
 */
public class TenantIdMessagePostProcessor implements MessagePostProcessor {
    @Override
    public Message<?> postProcessMessage(Message<?> message) {
        // todo 获取租户
        return MessageBuilder.fromMessage(message)
                .setHeaderIfAbsent("tenantId", "1")
                .build();
    }
}
